package com.jeejam.cart.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jeejam.cart.pojo.Cart;
import com.jeejam.cart.pojo.CartItem;
import com.jeejam.framework.base.service.BaseService;

public interface CartService extends BaseService{
	
//	public Cart getCart(HttpServletRequest request) throws Exception;

	public Cart getCartByCookie(HttpServletRequest request) throws Exception;
	
	public void add(Cart currentCart, CartItem cartItem, HttpServletRequest request, HttpServletResponse response) throws Exception;
	
	public String parse(Cart cart);
	
	public Cart translat(String cartStr);
	
	public void saveWithMember(int userId, HttpServletRequest request, HttpServletResponse response) throws Exception;
	
	public void clearByCookie(HttpServletRequest request, HttpServletResponse response) throws Exception;
	
	public void deleteByCookie(HttpServletResponse response) throws Exception;
	
	public Cart findByUserId(int userId);
	
	public void addWithMember(Cart currentCart, CartItem cartItem, int userId);
	
	public void clearByUserId(int userId);
	
	public void deleteItemByProductId(int productId, HttpServletRequest request, HttpServletResponse response) throws Exception;
	
	public void deleteWithMember(int userId, int productId);
	
	public Cart findForConfirmByUserId(int userId);
	
}
